// This file is part of Acala.

// Copyright (C) 2020-2025 Acala Foundation.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0

// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for nutsfinance_stable_asset
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 35.0.1
//! DATE: 2024-04-29, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `ip-172-31-41-141`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//! WASM-EXECUTION: Compiled, CHAIN: Some("acala-dev"), DB CACHE: 1024

// Executed Command:
// target/production/acala
// benchmark
// pallet
// --chain=acala-dev
// --steps=50
// --repeat=20
// --pallet=*
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./templates/runtime-weight-template.hbs
// --output=./runtime/acala/src/weights/

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for nutsfinance_stable_asset.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> nutsfinance_stable_asset::WeightInfo for WeightInfo<T> {
	// Storage: `StableAsset::PoolCount` (r:1 w:1)
	// Proof: `StableAsset::PoolCount` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `StableAsset::Pools` (r:1 w:1)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:1 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	fn create_pool() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1345`
		//  Estimated: `4810`
		// Minimum execution time: 23_339 nanoseconds.
		Weight::from_parts(23_968_000, 4810)
			.saturating_add(T::DbWeight::get().reads(3))
			.saturating_add(T::DbWeight::get().writes(3))
	}
	// Storage: `StableAsset::Pools` (r:1 w:1)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn modify_a() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1538`
		//  Estimated: `5003`
		// Minimum execution time: 19_819 nanoseconds.
		Weight::from_parts(20_242_000, 5003)
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	// Storage: `StableAsset::Pools` (r:1 w:1)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn modify_fees() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1538`
		//  Estimated: `5003`
		// Minimum execution time: 18_727 nanoseconds.
		Weight::from_parts(19_573_000, 5003)
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	// Storage: `StableAsset::Pools` (r:1 w:1)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	fn modify_recipients() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1538`
		//  Estimated: `5003`
		// Minimum execution time: 18_786 nanoseconds.
		Weight::from_parts(19_354_000, 5003)
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	// Storage: `StableAsset::Pools` (r:1 w:1)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:2 w:2)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:10 w:10)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalStakingBonded` (r:1 w:0)
	// Proof: `Homa::TotalStakingBonded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Homa::ToBondPool` (r:1 w:0)
	// Proof: `Homa::ToBondPool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::TotalIssuance` (r:2 w:1)
	// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalVoidLiquid` (r:1 w:0)
	// Proof: `Homa::TotalVoidLiquid` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `AssetRegistry::AssetMetadatas` (r:1 w:0)
	// Proof: `AssetRegistry::AssetMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `u` is `[2, 5]`.
	fn mint(u: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2333 + u * (167 ±0)`
		//  Estimated: `6196 + u * (5244 ±0)`
		// Minimum execution time: 144_353 nanoseconds.
		Weight::from_parts(74_954_689, 6196)
			// Standard Error: 316_516
			.saturating_add(Weight::from_parts(39_086_822, 0).saturating_mul(u.into()))
			.saturating_add(T::DbWeight::get().reads(2))
			.saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(u.into())))
			.saturating_add(T::DbWeight::get().writes(4))
			.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(u.into())))
			.saturating_add(Weight::from_parts(0, 5244).saturating_mul(u.into()))
	}
	// Storage: `StableAsset::Pools` (r:1 w:1)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:1 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:6 w:3)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalStakingBonded` (r:1 w:0)
	// Proof: `Homa::TotalStakingBonded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Homa::ToBondPool` (r:1 w:0)
	// Proof: `Homa::ToBondPool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::TotalIssuance` (r:2 w:1)
	// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalVoidLiquid` (r:1 w:0)
	// Proof: `Homa::TotalVoidLiquid` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `AssetRegistry::AssetMetadatas` (r:1 w:0)
	// Proof: `AssetRegistry::AssetMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `u` is `[2, 5]`.
	fn swap(u: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2560 + u * (164 ±0)`
		//  Estimated: `6034 + u * (2622 ±0)`
		// Minimum execution time: 1_903_375 nanoseconds.
		Weight::from_parts(525_963_057, 6034)
			// Standard Error: 5_332_337
			.saturating_add(Weight::from_parts(740_601_451, 0).saturating_mul(u.into()))
			.saturating_add(T::DbWeight::get().reads(2))
			.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(u.into())))
			.saturating_add(T::DbWeight::get().writes(6))
			.saturating_add(Weight::from_parts(0, 2622).saturating_mul(u.into()))
	}
	// Storage: `StableAsset::Pools` (r:1 w:1)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:1 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:10 w:10)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalStakingBonded` (r:1 w:0)
	// Proof: `Homa::TotalStakingBonded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Homa::ToBondPool` (r:1 w:0)
	// Proof: `Homa::ToBondPool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::TotalIssuance` (r:2 w:1)
	// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalVoidLiquid` (r:1 w:0)
	// Proof: `Homa::TotalVoidLiquid` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `AssetRegistry::AssetMetadatas` (r:1 w:0)
	// Proof: `AssetRegistry::AssetMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `u` is `[2, 5]`.
	fn redeem_proportion(u: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2502 + u * (229 ±0)`
		//  Estimated: `5975 + u * (5244 ±0)`
		// Minimum execution time: 170_053 nanoseconds.
		Weight::from_parts(103_128_928, 5975)
			// Standard Error: 228_662
			.saturating_add(Weight::from_parts(37_719_569, 0).saturating_mul(u.into()))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(u.into())))
			.saturating_add(T::DbWeight::get().writes(3))
			.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(u.into())))
			.saturating_add(Weight::from_parts(0, 5244).saturating_mul(u.into()))
	}
	// Storage: `StableAsset::Pools` (r:1 w:0)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:1 w:0)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:4 w:0)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalStakingBonded` (r:1 w:0)
	// Proof: `Homa::TotalStakingBonded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Homa::ToBondPool` (r:1 w:0)
	// Proof: `Homa::ToBondPool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::TotalIssuance` (r:1 w:0)
	// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalVoidLiquid` (r:1 w:0)
	// Proof: `Homa::TotalVoidLiquid` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	/// The range of component `u` is `[2, 5]`.
	fn redeem_single(u: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `1630 + u * (225 ±0)`
		//  Estimated: `5145 + u * (1016 ±0)`
		// Minimum execution time: 1_495_762 nanoseconds.
		Weight::from_parts(793_943_725, 5145)
			// Standard Error: 1_267_338
			.saturating_add(Weight::from_parts(370_164_386, 0).saturating_mul(u.into()))
			.saturating_add(T::DbWeight::get().reads(3))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into())))
			.saturating_add(Weight::from_parts(0, 1016).saturating_mul(u.into()))
	}
	// Storage: `StableAsset::Pools` (r:1 w:1)
	// Proof: `StableAsset::Pools` (`max_values`: None, `max_size`: None, mode: `Measured`)
	// Storage: `System::Account` (r:1 w:1)
	// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
	// Storage: `Tokens::Accounts` (r:10 w:10)
	// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(147), added: 2622, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalStakingBonded` (r:1 w:0)
	// Proof: `Homa::TotalStakingBonded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Homa::ToBondPool` (r:1 w:0)
	// Proof: `Homa::ToBondPool` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `Tokens::TotalIssuance` (r:2 w:1)
	// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
	// Storage: `Homa::TotalVoidLiquid` (r:1 w:0)
	// Proof: `Homa::TotalVoidLiquid` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
	// Storage: `AssetRegistry::AssetMetadatas` (r:1 w:0)
	// Proof: `AssetRegistry::AssetMetadatas` (`max_values`: None, `max_size`: None, mode: `Measured`)
	/// The range of component `u` is `[2, 5]`.
	fn redeem_multi(u: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `2502 + u * (229 ±0)`
		//  Estimated: `5975 + u * (5244 ±0)`
		// Minimum execution time: 147_592 nanoseconds.
		Weight::from_parts(66_503_575, 5975)
			// Standard Error: 426_108
			.saturating_add(Weight::from_parts(45_813_398, 0).saturating_mul(u.into()))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().reads((4_u64).saturating_mul(u.into())))
			.saturating_add(T::DbWeight::get().writes(3))
			.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(u.into())))
			.saturating_add(Weight::from_parts(0, 5244).saturating_mul(u.into()))
	}
}
